.global __lock_sem_access

__lock_sem_access:
/* r0 contains the memory address */
mov r2, #0x1
spin:
swp r1, r2, [r0]
cmp r1, #0
bne spin
mov pc, lr

.end
